home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.51 / xpk / docs / philosophy.doc < prev    next >
Text File  |  1995-08-27  |  6KB  |  159 lines

  1.  
  2. XPK - A NEW STANDARD FOR DATA COMPRESSION
  3. =========================================
  4.  
  5. MOTIVATION
  6. ----------
  7. * Many programs that should offer data compression (e.g. HD backup utilities)
  8.   don't.
  9. * Many programs that offer data compression use an old, slow, inefficient or
  10.   inappropriate algorithm.
  11. * All programs that offer data compression offer just one algorithm, you're
  12.   stuck with that one.
  13. * Many good packers are not used by any application program and have no
  14.   good user interface.
  15. * The installation of most packers requires AmigaShell knowledge (putting
  16.   LHarc in the path so that DiskMaster can find it)
  17. * The decompression of all files packed with existing packers requires
  18.   knowledge about the packer used for compression.
  19. * Many compression programs can not deal with files that are larger than
  20.   available memory.
  21. * The existing compression programs are either slow or have a low 
  22.   compression factor.
  23. * There is no way to support upcoming hardware compression cards in already
  24.   existing applications yet.  
  25. * For none of the current compression programs exists a real decompressing 
  26.   file handler that uses no dirty tricks to decompress files on the fly.
  27.  
  28. The solution to all these problems is xpk.
  29.  
  30.  
  31. OVERVIEW
  32. --------
  33. The xpk standard is to data compression what xpr is to file transmission.
  34. It consists of three layers:
  35. Level 2: The application/xpk interface for archives (planned)
  36. Level 1: The application/xpk interface for files
  37. Level 0: The xpk/packer interface
  38. In addition, there is an optional standard xpk file format.
  39.  
  40. All parts of the xpk standard are implemented in shared libraries. There
  41. is one master library for archive level access, one master library for file
  42. level access, and one library for each compression algorithm.
  43.  
  44. level 2            xpkarchive.library
  45.                            |
  46.                            V
  47. level 1             xpkmaster.library
  48.                      /     |     \
  49.                     /      |      \
  50.                    V       V       V
  51. level 0          xpkNUKE  xpkZOO  xpkLHARC
  52.  
  53.  
  54.  
  55. LEVEL 0 LIBRARIES
  56. -----------------
  57. All level 0 libraries offer the same functions. They're very small. Typical 
  58. calls are: "Tell me what you can", "Compress this chunk of memory to another
  59. chunk of memory", and "Decompress this chunk of memory to another chunk of
  60. memory". These libs are very limited, their functionality is expanded by
  61. xpkmaster.library. No one would want to talk to a sub library directly.
  62.  
  63.  
  64. THE LEVEL 1 LIBRARY
  65. -------------------
  66. Offers functions like "Compress this file to that chunk of memory using that
  67. algorithm". All combinations permitted: Mem to mem, file to file, mem to file,
  68. decompression and compression. Asynchronous packing possible. Very convenient
  69. tag based caller interface. Automatically finds out which sub library to use
  70. for decompression. Returns detailed error messages.
  71.  
  72.  
  73. THE LEVEL 2 LIBRARY
  74. -------------------
  75. Offers archiving functions like "add this file to that archive" or "show
  76. me the contents of that archive". Not implemented yet.
  77.  
  78.  
  79. OVERRIDING
  80. ----------
  81. Libraries of a lower level can offer higher level functions. They then 
  82. override the automatic functinality expansion by the higher level library.
  83. xpkmaster.library, for example, enforces the use of the xpk standard file
  84. format unless overridden by a sub library.
  85.  
  86.  
  87. THE XPK FILE FORMAT
  88. -------------------
  89. Offers checksums, chunks (important when Seek()s on a compressed file become
  90. necessary) and automatic handling by the xpkmaster.library. This means that
  91. any new packer that can only pack mem to mem has its own file format 
  92. immediately. And most important: The name of the packer library is contained
  93. in the file. Therefore, copying a new sub library to LIBS: is all you
  94. have to do to install a new packer (easily done in installation scripts);
  95. xpkmaster.library recognizes the new file type immediately. No changes to 
  96. xpkmaster.library or the application programs necessary. In case the xpk
  97. file format is not used, the introduction of a new packer requires a change
  98. the xpkmaster.library.
  99.  
  100.  
  101. THE EXISTING PACKERS
  102. --------------------
  103. Two excellent unpublished compression programs already use the xpk standard.
  104.  
  105. * BLZW (Bryan's LZW)
  106.   Combines unseen compression speed with fast decompression speed and a
  107.   resonable compression factor. Timings on the 25 MHz A3000:
  108.  
  109.   Compression speed  : 100-120K/sec
  110.   Decompression speed: 200-250K/sec
  111.   Compression factor : Like ZOO
  112.  
  113. * NUKE
  114.   Designed for lightning fast decompression while retaining a good compresion
  115.   factor.
  116.  
  117.   Compression speed  :  30- 40K/sec
  118.   Decompression speed: 650-700K/sec
  119.   Compression factor : Like LHarc, 1-2% worse
  120.  
  121. * PowerPacker
  122.   Is supported for decompression only. This is a hack in the xpkmaster.library.
  123.  
  124. For comparison: The fastest packer so far (Zoo) packs 35K/sec, the fastest
  125. unpacker so far (Imploder) decompresses 240K/sec. Detailed statistics are
  126. available.
  127.  
  128.  
  129. TYPICAL APPLICATIONS
  130. --------------------
  131. A few examples for applications that could use xpk:
  132. * A GadTools based archiver interface that can deal with all archivers
  133. * A CLI based file compressor/decompressor
  134. * A hard disk backup utility that stores compressed data
  135. * A 'more' program with automatic decompression
  136. * A DTP program that stores its fonts in compressed format
  137. * A network protocol with built in data compression for slow connections
  138. * A hypertext utility that allows all data to be compressed
  139. * A file handler that overlays an existing filesystem and uncompresses any 
  140.   file while loading
  141. ...plus many more we don't even need to think about yet.
  142.  
  143.  
  144. OTHER USES FOR XPK
  145. ------------------
  146. Xpk could become an all purpose file conversion facility. E.g. it could
  147. be used to convert JPEG images to IFF images while loading them into
  148. DPaint, or encrypt files, or add redundancy to files for error correction.
  149.  
  150.  
  151. CONCLUSION
  152. ----------
  153. Xpk would increase the usefulness and flexibility of both application and 
  154. compression programs while improving their user friendliness at the same
  155. time. The best way to establish this standard is distributing it on the
  156. workbench disk that comes with every Amiga.
  157.  
  158.  U. Dominik Mueller              umueller@amiga.physik.unizh.ch
  159.